package com.hiwhitley.himei.module.game;

import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.hiwhitley.himei.R;
import com.hiwhitley.himei.entity.GameScreenHorizontal;
import com.hiwhitley.himei.widget.glide.GlideImageView;

import butterknife.BindView;
import butterknife.ButterKnife;
import me.drakeet.multitype.ItemViewProvider;

/**
 * Created by hiwhitley on 17-2-26.
 */
public class GameScreenHorizontalViewProvider
        extends ItemViewProvider<GameScreenHorizontal, GameScreenHorizontalViewProvider.ViewHolder> {



    @NonNull
    @Override
    protected ViewHolder onCreateViewHolder(
            @NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
        View root = inflater.inflate(R.layout.item_game_screen_horizontal, parent, false);
        return new ViewHolder(root);
    }

    @Override
    protected void onBindViewHolder(@NonNull ViewHolder holder, @NonNull GameScreenHorizontal gameScreenHorizontal) {
        holder.mIvGameItem.loadNetImage(gameScreenHorizontal.getScreens().getRaw().getUrl(), R.drawable.bg_holder_brown);
    }

    static class ViewHolder extends RecyclerView.ViewHolder {
        @BindView(R.id.iv_game_item)
        GlideImageView mIvGameItem;
        ViewHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this, itemView);
        }
    }
}